package com.rssreader.client.services;

import java.util.List;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.rssreader.shared.model.Category;
import com.rssreader.shared.model.Feed;
import com.rssreader.shared.model.Item;

@RemoteServiceRelativePath("feed-service")
public interface FeedService extends RemoteService {
    Feed createNewFeed();

    void saveFeed(Feed feed);

    void addExistingFeed(String feedUrl);

    List<Feed> loadFeedList(boolean loadItems);

    List<Item> loadItems(String feedUrl);// non-paging

    PagingLoadResult<Item> loadItems(String feedUrl, final PagingLoadConfig config);// paging

    // delivers only the Item objects in a given category
    List<ModelData> loadCategorisedItems(String feedUrl, Category category);
}
